const { ref, reactive } = Vue

const testManage = () => {
  const hello = ref('你好，世界')
  const clickMe = () => {
    hello.value = '好的，收到，现在时间：' + new Date()
  }

  return {
    hello,
    clickMe
  }
}

// vue3的对象
export default {
  components: {
    Banner: Vue.defineAsyncComponent(() => myImport('components/Banner'))
  },
  template: ``,
  setup () {
    // 使用外面的定义，分解setup内部的代码
    const { hello, clickMe } = testManage()
    const value = reactive({
      name: 'ping1'
    })
    const bannerArr = reactive([
      { title: 'A', imgUrl: 'http://www.muruji.cn/image/indexImg/banner1.jpg', url: '' },
      { title: 'B', imgUrl: 'http://www.muruji.cn/image/indexImg/banner2.jpg', url: '' }
    ])
    return {
      bannerArr,
      value,
      hello,
      clickMe
    }
  }
}
